package com.qdxwx.models.coupon;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class Coupon implements Serializable{

    private static final long serialVersionUID = 2962696141399607105L;

    private Long id;
    /**
     * 优惠卷名称
     */
    private String title;
    /**
     * 使用说明
     */
    private String info;

    /**
     * 有效期开始时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate startDate;
    /**
     * 有效期结束时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endDate;
    /**
     * 使用限额0.不限制，否则大于等于
     */
    private Integer limitAmount;
    /**
     * 优惠金额:打折存折扣，定额存优惠金额
     */
    private Integer amount;
    /**
     * 指的是该优惠券的适用范围_项目ID
     */
    private Integer channelId;
    /**
     * 生成数量
     */
    private Long totalNum;
    /**
     * 生成类型：1。公用（只生成1个优惠券，有效期内所有人都可以使用）2，每人独立使用
     */
    private Integer useType;
    /**
     * 类型1为打折2定额3会员优惠券（定额）
     */
    private Integer type;
    /**
     * 已使用数量
     */
    private Integer useNum;
    /**
     * 操作者
     */
    private String managerName;
    /**
     * 优惠券发放类型 0 普通发放 1 分享注册 2 购买课程
     */
    private Integer giveType;
    /**
     * 以赠送的数量
     */
    private Integer givenNum;
    /**
     * 状态 ：normal正常 overdue过期
     */
    private String status;

    /**
     * 创建时间
     */
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    public Coupon() {
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public void setEndDate(LocalDate endDate) {
        this.endDate = endDate;
    }

    public Integer getLimitAmount() {
        return limitAmount;
    }

    public void setLimitAmount(Integer limitAmount) {
        this.limitAmount = limitAmount;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public Long getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Long totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getUseType() {
        return useType;
    }

    public void setUseType(Integer useType) {
        this.useType = useType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getUseNum() {
        return useNum;
    }

    public void setUseNum(Integer useNum) {
        this.useNum = useNum;
    }

    public String getManagerName() {
        return managerName;
    }

    public void setManagerName(String managerName) {
        this.managerName = managerName;
    }

    public Integer getGiveType() {
        return giveType;
    }

    public void setGiveType(Integer giveType) {
        this.giveType = giveType;
    }

    public Integer getGivenNum() {
        return givenNum;
    }

    public void setGivenNum(Integer givenNum) {
        this.givenNum = givenNum;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Coupon{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", info='" + info + '\'' +
                ", createTime=" + createTime +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                ", limitAmount=" + limitAmount +
                ", amount=" + amount +
                ", channelId='" + channelId + '\'' +
                ", totalNum=" + totalNum +
                ", useType=" + useType +
                ", type=" + type +
                ", useNum=" + useNum +
                ", managerName='" + managerName + '\'' +
                ", giveType=" + giveType +
                ", givenNum=" + givenNum +
                ", status='" + status + '\'' +
                '}';
    }
}
